# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=dnstwist
pkgver=20230918
pkgrel=0
pkgdesc="Domain name permutation engine"
options="!check" # no testsuite
url="https://dnstwist.it"
arch="noarch"
license="Apache-2.0"
depends="
	py3-dnspython
	py3-geoip2
	py3-idna
	py3-requests
	py3-tld
	py3-whois
	python3
	"
makedepends="py3-setuptools"
subpackages="$pkgname-dictionaries $pkgname-pyc"

source="$pkgname-$pkgver.tar.gz::https://github.com/elceef/dnstwist/archive/$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

dictionaries() {
	pkgdesc="Dictionaries for dnstwist"
	depends=""

	mkdir -p "$subpkgdir"/usr/share/dnstwist/dictionaries
	for dict in "$builddir"/dictionaries/*.dict; do
		install -Dm0644 "$dict" "$subpkgdir"/usr/share/dnstwist/dictionaries/"$(basename $dict)"
	done
}

sha512sums="
0a52e41c30dee66cd667603af629bbf7ff4e7f5868b28fb9a0b1f2ebc0f29c8bf0982a027a4e458b2ef92eeae539efc1a72f7a01de775533915bea8e832bdbdb  dnstwist-20230918.tar.gz
"
